package com.premierleaguestats.client;

import com.google.gwt.event.logical.shared.ValueChangeEvent;
import com.google.gwt.event.logical.shared.ValueChangeHandler;
import com.google.gwt.user.client.ui.RootPanel;

public class MyHistoryListener implements ValueChangeHandler<String> {

	@Override
	public void onValueChange(ValueChangeEvent<String> event) {
        System.out.println("Current State : " + event.getValue());
        
        if (event.getValue().equals("teamstats")){
        	System.out.println("MyHistoryListener teamstats");
        	RootPanel.get("content").clear();
            RootPanel.get("content").add(TeamStats.getInstance());
        }
        
        if (event.getValue().equals("winnerstats")){
        	System.out.println("MyHistoryListener winnerstats");
            RootPanel.get("content").clear();
            RootPanel.get("content").add(WinnerStats.getInstance());
        }    
    }	
		
}



